<?php
declare (strict_types = 1);

namespace app\api\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class UserCredit extends Model
{
	protected $pk='id';
    

 	
    /**
     * 信用加分依据
     * @var [type]
     */
    public static function  creditBasic($int=0){
    	$res =  [
             //期限内确认完成
             'complete_mission_l20'=>['需求方-派发金币接近配置总额，相差不超过20%',20],
             'complete_mission_l50'=>['需求方-派发金币接近配置总额，相差不超过50%',10],
             'complete_mission_m50'=>['需求方-派发金币跟配置相差较大,相差超过50%',2],
             //到期后确认完成
             'complete_mission_exp_l20'=>['需求方-过期操作-派发金币接近配置总额，相差不超过20%',10],
             'complete_mission_exp_l50'=>['需求方-过期操作-派发金币接近配置总额，相差不超过50%',5],
             'complete_mission_exp_m50'=>['需求方-过期操作-派发金币跟配置相差较大,相差超过50%',1],
             //任务完成占比奖励
             'complete_pct50'=>['需求方-当月发布，确认的完成占比达到50%',10],
             'complete_pct100'=>['需求方-当月发布，确认的完成占比达到100%',50],
             //发布任务
             'mission_create'=>['需求方-发布任务增加积分',3],
             'mission_pub10'=>['需求方-发布任务数且成功付款的超过10个',10],
             'mission_double10'=>['需求方-发布任务总数递推奖励',10],
           
             //充值
             'recharge'=>['充值美元加分',2],
             //评价           
             'prise5'=>['5星评级',5],
             'prise4'=>['4星评级',4],             
             'prise2'=>['2星评级',-3],
             'prise1'=>['1星评级',-5],
             //评论
             'replay'=>['需求方-回复评论',+5],
             'noreplay10'=>['需求方-当月不回复',-10],
             //任务参与
             'mission_sign'=>['服务方-任务报名',5],
             'manuscript_accept'=>['服务方-稿件被采纳',5],
             'manuscript_qualified'=>['服务方-稿件合格',5],
             'add_comment'=>['服务方-发表评论',1],
             
             'arbitration_win'=>['服务方-仲裁成功',10],

              //资料
             'profile_mobile'=>['有输入手机号',10],
             'profile_email_vetify'=>['有认证邮箱',10],
             'profile_truename'=>['有补充真实姓名',5],
             'profile_complete'=>['补全资料',5],

             //活跃度
             'month_login10'=>['月内登陆10次',10],
             'month_login10'=>['月内登陆10次',10],
             'month_prise5'=>['月内好评超过5个',10],
             
             
    	];

        return $res;
    }

    /**
     * 会员信用级别
     * @return [type] [description]
     */
   public static function creditLevel($k=null){
        $r =  [
            1=>['credit_level_emerging','0,100'],
            2=>['credit_level_silver','100,500'],
            3=>['credit_level_gold','500,1000'],
            4=>['credit_level_platinum','1000,2000'],
            5=>['credit_level_diamonds','2000,-'],           
        ];
        return $k?$r[$k]:$r;
    }


   

}
